#include <regex>
#include <string>
#include <iostream>

int main()
{
   std::string req("POST /space/dock HTTP/1.0\r\n");
   std::smatch sm;
   std::regex e("(GET|POST|HEAD|DELETE) ([^?]*)(?:\\?(.*))* HTTP/(1.[10])(?:\n|\r\n)");
   std::regex_match(req, sm, e);
   for (auto& s : sm) {
      std::cout << s << std::endl;
   }
   return 0;
}
